package com.hzit.bj1804.dianservice.controller;

import com.hzit.bj1804.dian.entity.Diaryinfo;
import com.hzit.bj1804.dianservice.service.DiaryinfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
public class DiaryinfoController {
    @Autowired
    DiaryinfoService diaryinfoService;
    @RequestMapping("dseleAll")
    @ResponseBody
    /**
     * 查询所有登陆日志
     */
    public Object seleAll(){

        return diaryinfoService.seleAll();
    }
    @RequestMapping("dinsert")
    @ResponseBody
    /**
     * 添加登陆日志
     * @param diaryinfo
     * @return
     */
    public Object insert(@RequestBody Diaryinfo diaryinfo){
        System.out.println("DDDDDDDDDDDDDDD");
        return diaryinfoService.insert(diaryinfo);
    }
    /**
     * 分页查询
     * @param
     * @return
     */
    @RequestMapping("dseleAllPage")
    @ResponseBody
    public Object seleAllPage(@RequestParam("limit") int limit, @RequestParam("page") int page){
        return diaryinfoService.seleAllPage(limit,page);
    }
}
